import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/car_entity.dart';
import 'package:library_base/entities/purchase_order_child_entity.dart';
import 'package:library_base/entities/purchase_order_entity.dart';

PurchaseOrderChildEntity $PurchaseOrderChildEntityFromJson(Map<String, dynamic> json) {
  final PurchaseOrderChildEntity loginBeanEntity = PurchaseOrderChildEntity();

  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    loginBeanEntity.goodsName = goodsName;
  }

  final double? purchaseWeight = jsonConvert.convert<double>(json['purchaseWeight']);
  if (purchaseWeight != null) {
    loginBeanEntity.purchaseWeight = purchaseWeight;
  }

  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    loginBeanEntity.price = price;
  }

  final double? serviceCost = jsonConvert.convert<double>(json['serviceCost']);
  if (serviceCost != null) {
    loginBeanEntity.serviceCost = serviceCost;
  }

  final double? totalCost = jsonConvert.convert<double>(json['totalCost']);
  if (totalCost != null) {
    loginBeanEntity.totalCost = totalCost;
  }

  final String? unit = jsonConvert.convert<String>(json['unit']);
  if (unit != null) {
    loginBeanEntity.unit = unit;
  }

  return loginBeanEntity;
}

Map<String, dynamic> $PurchaseOrderChildEntityToJson(PurchaseOrderChildEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['goodsName'] = entity.goodsName;
  data['purchaseWeight'] = entity.purchaseWeight;
  data['price'] = entity.price;
  data['serviceCost'] = entity.serviceCost;
  data['totalCost'] = entity.totalCost;
  data['unit'] = entity.unit;
  return data;
}
